import { normal_carry_max, t2_pb_max } from "utils/constants/definetypes";
export const t3_target_config_={
    addition:10000,
    max:100000
}
/**
 * lab 合成目标
 */
 export interface LabTarget {
    /**
     *  化合物
     */
    target: MineralConstant|MineralCompoundConstant
    /**
     *  数量
     */
    number: number
    amount?:number; // 当前数量
}

/**
 * 反应底物表接口
 */
export interface ReactionSource {
    [targetResourceName: string]: (MineralConstant | MineralCompoundConstant)[]
}

export interface LabReaction
{
    Reactant:LabTarget
    BaseA:LabTarget
    BaseB:LabTarget
}

/**
 * 强化任务的材料清单
 */
export interface BoostResourceConfig {
    /**
     * 强化材料类型
     */
    resource: MineralBoostConstant
    /**
     * 强化材料数量
     */
    amount: number
}


/**
 * 从反应目标产物获取其底物的对应表
 */
 export const REACTION_SOURCE: ReactionSource = {
    // 三级化合物
    [RESOURCE_CATALYZED_GHODIUM_ACID]: [RESOURCE_GHODIUM_ACID, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_GHODIUM_ALKALIDE]: [RESOURCE_GHODIUM_ALKALIDE, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_KEANIUM_ACID]: [RESOURCE_KEANIUM_ACID, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_KEANIUM_ALKALIDE]: [RESOURCE_KEANIUM_ALKALIDE, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_LEMERGIUM_ACID]: [RESOURCE_LEMERGIUM_ACID, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE]: [RESOURCE_LEMERGIUM_ALKALIDE, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_UTRIUM_ACID]: [RESOURCE_UTRIUM_ACID, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_UTRIUM_ALKALIDE]: [RESOURCE_UTRIUM_ALKALIDE, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_ZYNTHIUM_ACID]: [RESOURCE_ZYNTHIUM_ACID, RESOURCE_CATALYST],
    [RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE]: [RESOURCE_ZYNTHIUM_ALKALIDE, RESOURCE_CATALYST],
    // 二级化合物
    [RESOURCE_GHODIUM_ACID]: [RESOURCE_GHODIUM_HYDRIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_GHODIUM_ALKALIDE]: [RESOURCE_GHODIUM_OXIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_KEANIUM_ACID]: [RESOURCE_KEANIUM_HYDRIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_KEANIUM_ALKALIDE]: [RESOURCE_KEANIUM_OXIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_LEMERGIUM_ACID]: [RESOURCE_LEMERGIUM_HYDRIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_LEMERGIUM_ALKALIDE]: [RESOURCE_LEMERGIUM_OXIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_UTRIUM_ACID]: [RESOURCE_UTRIUM_HYDRIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_UTRIUM_ALKALIDE]: [RESOURCE_UTRIUM_OXIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_ZYNTHIUM_ACID]: [RESOURCE_ZYNTHIUM_HYDRIDE, RESOURCE_HYDROXIDE],
    [RESOURCE_ZYNTHIUM_ALKALIDE]: [RESOURCE_ZYNTHIUM_OXIDE, RESOURCE_HYDROXIDE],
    // 一级化合物
    [RESOURCE_GHODIUM_HYDRIDE]: [RESOURCE_GHODIUM, RESOURCE_HYDROGEN],
    [RESOURCE_GHODIUM_OXIDE]: [RESOURCE_GHODIUM, RESOURCE_OXYGEN],
    [RESOURCE_KEANIUM_HYDRIDE]: [RESOURCE_KEANIUM, RESOURCE_HYDROGEN],
    [RESOURCE_KEANIUM_OXIDE]: [RESOURCE_KEANIUM, RESOURCE_OXYGEN],
    [RESOURCE_LEMERGIUM_HYDRIDE]: [RESOURCE_LEMERGIUM, RESOURCE_HYDROGEN],
    [RESOURCE_LEMERGIUM_OXIDE]: [RESOURCE_LEMERGIUM, RESOURCE_OXYGEN],
    [RESOURCE_UTRIUM_HYDRIDE]: [RESOURCE_UTRIUM, RESOURCE_HYDROGEN],
    [RESOURCE_UTRIUM_OXIDE]: [RESOURCE_UTRIUM, RESOURCE_OXYGEN],
    [RESOURCE_ZYNTHIUM_HYDRIDE]: [RESOURCE_ZYNTHIUM, RESOURCE_HYDROGEN],
    [RESOURCE_ZYNTHIUM_OXIDE]: [RESOURCE_ZYNTHIUM, RESOURCE_OXYGEN],
    [RESOURCE_GHODIUM]: [RESOURCE_ZYNTHIUM_KEANITE, RESOURCE_UTRIUM_LEMERGITE],
    // 基础化合物
    [RESOURCE_ZYNTHIUM_KEANITE]: [RESOURCE_ZYNTHIUM, RESOURCE_KEANIUM],
    [RESOURCE_UTRIUM_LEMERGITE]: [RESOURCE_UTRIUM, RESOURCE_LEMERGIUM],
    [RESOURCE_HYDROXIDE]: [RESOURCE_HYDROGEN, RESOURCE_OXYGEN]
}

const t2_store_amount=10000 // t2 的储备

export const  LAB_TARGETS_COMBAT: LabTarget[] = [

   
    // XZHO2 生产线，强化 MOVE
    { target: RESOURCE_ZYNTHIUM_OXIDE, number: normal_carry_max },
    { target: RESOURCE_ZYNTHIUM_ALKALIDE, number: t2_store_amount },
   


    // XZH2O 生产线，强化 WORK 的 dismantle
    { target: RESOURCE_ZYNTHIUM_HYDRIDE, number: normal_carry_max },
    { target: RESOURCE_ZYNTHIUM_ACID, number: t2_store_amount },
  

     // XUHO2 生产线，强化 ATTACK
     { target: RESOURCE_UTRIUM_HYDRIDE, number: normal_carry_max },
     { target: RESOURCE_UTRIUM_ACID, number: t2_store_amount },    // 储备一点用于挖power

     // XLHO2 生产线，强化 HEAL
     { target: RESOURCE_LEMERGIUM_OXIDE, number: normal_carry_max },
     { target: RESOURCE_LEMERGIUM_ALKALIDE, number: t2_store_amount },// 储备一点用于挖power
     
    // XKHO2 生产线，强化 RANGE_ATTACK
    { target: RESOURCE_KEANIUM_OXIDE, number: normal_carry_max },
    { target: RESOURCE_KEANIUM_ALKALIDE, number: t2_store_amount },
  
  


    // XGHO2 生产线，强化 TOUGH
    { target: RESOURCE_GHODIUM_OXIDE, number: normal_carry_max },
    { target: RESOURCE_GHODIUM_ALKALIDE, number: t2_store_amount },

    { target: RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE, number: 50000 },
    { target: RESOURCE_CATALYZED_ZYNTHIUM_ACID, number: 50000 },
    { target: RESOURCE_CATALYZED_UTRIUM_ACID, number: 50000 },
    { target: RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE, number: 50000 },
    { target: RESOURCE_CATALYZED_KEANIUM_ALKALIDE, number: 50000 },
    { target: RESOURCE_CATALYZED_GHODIUM_ALKALIDE, number: 50000 },

]
export const  LAB_TARGETS_BASE: LabTarget[] = [
    // 基础
    { target: RESOURCE_HYDROXIDE, number: normal_carry_max },
    { target: RESOURCE_ZYNTHIUM_KEANITE, number: normal_carry_max },
    { target: RESOURCE_UTRIUM_LEMERGITE, number: normal_carry_max },
    // G
    { target: RESOURCE_GHODIUM, number: 5000 },

]

export const  LAB_TARGETS_NORMAL: LabTarget[] = [

     // 维修建设
     { target: RESOURCE_LEMERGIUM_ACID , number: 20000 },
     { target: RESOURCE_LEMERGIUM_HYDRIDE , number: normal_carry_max },


    // 采集
    { target: RESOURCE_UTRIUM_OXIDE, number: normal_carry_max },
    { target: RESOURCE_UTRIUM_ALKALIDE, number: 10000 },

    // XGH20 生产线，强化 controller 升级
    { target: RESOURCE_GHODIUM_HYDRIDE, number: normal_carry_max },
    { target: RESOURCE_GHODIUM_ACID, number: 100000 },
    { target: RESOURCE_CATALYZED_GHODIUM_ACID, number: 50000 },
]
/**
 * lab 集群的目标产物及其数量列表
 * 更新此表后所有工作中的 lab 集群都会自动合成新增的产物
 */
export const LAB_TARGETS: LabTarget[] =  LAB_TARGETS_BASE.concat(LAB_TARGETS_NORMAL,LAB_TARGETS_COMBAT);

export const T3Targets:MineralCompoundConstant[]=[
    RESOURCE_CATALYZED_UTRIUM_ACID
    ,RESOURCE_CATALYZED_UTRIUM_ALKALIDE
    ,RESOURCE_CATALYZED_KEANIUM_ACID
    ,RESOURCE_CATALYZED_KEANIUM_ALKALIDE
    ,RESOURCE_CATALYZED_LEMERGIUM_ACID
    ,RESOURCE_CATALYZED_LEMERGIUM_ALKALIDE
    ,RESOURCE_CATALYZED_ZYNTHIUM_ACID
    ,RESOURCE_CATALYZED_ZYNTHIUM_ALKALIDE
    ,RESOURCE_CATALYZED_GHODIUM_ACID
    ,RESOURCE_CATALYZED_GHODIUM_ALKALIDE
]